var findNumberIn2DArray = function (matrix, target) {
    let row = matrix.length;
    let col = row ? matrix[0].length : 0;
    if (row == 0 || col == 0) return false;
    let x = row - 1;
    let y = 0;
    while (x >= 0 && y < col) {
        if (matrix[x][y] == target) {
            return true;
        } else if (matrix[x][y] > target) {
            --x;
        } else {
            y++;
        }
    }
    return false;
};